<template>
    <el-text type="primary" size="large" tag="对齐">4,添加在父容器上的语法 display:flex; justify-content 主轴对齐方式</el-text>
    <div class="content_box">
        <div class="child_content_box">
            <el-text class="mx-1">:flex-start; 默认</el-text>
            <div class="justify_content_start">
                <div class="child_before_box">1</div>
                <div class="child_before_box">2</div>
                <div class="child_before_box">3</div>
                <div class="child_before_box">4</div>
            </div>
        </div>
        <div class="child_content_box">
            <el-text class="mx-1">:center; X轴居中对齐</el-text>
            <div class="justify_content_center">
                <div class="child_before_box">1</div>
                <div class="child_before_box">2</div>
                <div class="child_before_box">3</div>
                <div class="child_before_box">4</div>
            </div>
        </div>
        <div class="child_content_box">
            <el-text class="mx-1">:flex-end; X轴末端对齐</el-text>
            <div class="justify_content_end">
                <div class="child_before_box">1</div>
                <div class="child_before_box">2</div>
                <div class="child_before_box">3</div>
                <div class="child_before_box">4</div>
            </div>
        </div>
        <div class="child_content_box">
            <el-text class="mx-1">:space-between; X轴两端对齐</el-text>
            <div class="justify_content_between">
                <div class="child_before_box">1</div>
                <div class="child_before_box">2</div>
                <div class="child_before_box">3</div>
                <div class="child_before_box">4</div>
            </div>
        </div>
        <div class="child_content_box">
            <el-text class="mx-1">:space-around; X轴均分对齐</el-text>
            <div class="justify_content_around">
                <div class="child_before_box">1</div>
                <div class="child_before_box">2</div>
                <div class="child_before_box">3</div>
                <div class="child_before_box">4</div>
            </div>
        </div>
        <div class="child_content_box">
            <el-text class="mx-1">:space-evenly; X轴空白间距完全相等</el-text>
            <div class="justify_content_around">
                <div class="child_before_box">1</div>
                <div class="child_before_box">2</div>
                <div class="child_before_box">3</div>
                <div class="child_before_box">4</div>
            </div>
        </div>
    </div>
</template>
<script setup >

</script>
<style scoped lang="scss">
.content_box {
    display: flex;
    flex-wrap: wrap;
}

.child_content_box {
    margin: 5px;
}

.justify_content_start {
    width: 200px;
    height: 200px;
    border: 2px solid #E4E7ED;
    display: flex;
    justify-content: start;
}

.justify_content_center {
    width: 200px;
    height: 200px;
    border: 2px solid #E4E7ED;
    display: flex;
    justify-content: center;
}
.justify_content_end{
    width: 200px;
    height: 200px;
    border: 2px solid #E4E7ED;
    display: flex;
    justify-content: flex-end;
}
.justify_content_between{
    width: 200px;
    height: 200px;
    border: 2px solid #E4E7ED;
    display: flex;
    justify-content: space-between;
}
.justify_content_around{
    width: 200px;
    height: 200px;
    border: 2px solid #E4E7ED;
    display: flex;
    justify-content: space-around;
}
.justify_content_around{
    justify-content: space-evenly;
}
.child_before_box {
    width: 40px;
    height: 40px;
    margin: 2px;
    background-color: red;
}

.child_before_box:nth-child(2) {
    background-color: #F56C6C;
}

.child_before_box:nth-child(3) {
    background-color: yellow;
}

.child_before_box:nth-child(4) {
    background-color: green;
}
</style>